package ysq.xyg.sys.model.po;

import lombok.Data;
import lombok.NoArgsConstructor;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统管理-附件管理实体类
 *
 * @author shengQiang yu
 * @date 2019-3-30 13:46:37
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_sys_file")
public class SysFile implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	
	/**
     * 附件名称
     */ 
	@Column(name = "file_name")
	private String fileName;
	
	/**
     * 附件大小
     */ 
	@Column(name = "file_size")
	private long fileSize;
	
	/**
     * 附件扩展名
     */ 
	@Column(name = "extend_name")
	private String extendName;
	
	/**
     * 附件标识
     */ 
	@Column(name = "file_tag")
	private String fileTag;
	
	/**
     * 附件类型：1、项目下保存，2、硬盘下保存，3、千牛云保存
     */ 
	@Column(name = "file_save_type")
	private String fileSaveType;
	
	/**
     * 附件路径
     */ 
	@Column(name = "path")
	private String path;
	/**
	 * 目录
	 */
	@Column(name = "catalog")
	private String catalog;
	/**
     * 删除标注:1、正常，2、删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;
	
	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;
	
	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;
	

	public SysFile(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}